<div class="judul"><?php echo anchor("/hasil_pemilihan_adik_asuh/", $title);?></div>
<?php
$uri_segment = $this->uri->segment(3);
if($uri_segment != "" && $uri_segment != "all"){
    $option = parsing_param2($uri_segment);
    $awal = datefmysql($option['awal']);
    $akhir = datefmysql($option['akhir']);
}else{
    $awal = date('d/m/Y');
    $akhir = date('d/m/Y');
}
?>
<div class="data-input">
    <fieldset>
        <legend><?php echo "$formTitle";?></legend>
        <?php
          echo form_open("hasil_pemilihan_adik_asuh/search");
        ?>
        <fieldset class="field-group">
            <legend style="width: 12em;">Tanggal Pemilihan Adik Asuh</legend>
            <?php echo form_input("awal", $awal, "id='awal' class='tanggal datepicker-input'")?>
            <label class="inline-title">s.d</label>
            <?php echo form_input("akhir", $akhir, "id='akhir' class='tanggal datepicker-input'")?>
        </fieldset>
        <fieldset class="input-process">
            <?php
              echo form_hidden("url", $searchLink);
              echo form_submit('add', 'Cari', 'class=button style=margin-right:2px');
              echo form_button('Batal', 'Batal', 'class=button onClick='."javascript:location.href='".base_url()."index.php/hasil_pemilihan_adik_asuh/'".'');
            ?>
        </fieldset>
        <?php
          echo form_close();
        ?>
    </fieldset>
</div>
<fieldset>
<?php
  if($uri_segment == ''){
      echo "<span class='tips'>Silahkan menggunakan opsi pencarian di atas</span>";
  }else{
?>     
<div class="data-list">
    <table class="tabel" style="width: 50%">
        <tr>
            <th>No</th>
            <th>Periode</th>
            <th>Tanggal</th>
            <th>Aksi</th>
        </tr>
        <?php
        $offsets = isset ($offset)?$offset:0;
        $no = 1 + $offsets;
        foreach ($listPemilihanAdikAsuh as $row){
        ?>
        <tr class="<?php echo ($no%2)?'even':'odd';?>">
            <td style="width: 5%;text-align: center"><?php echo $no++;?></td>
            <td><?php echo $row['periode'];?></td>
            <td><?php echo datefmysql($row['tanggal']);?></td>
            <td class="aksi">
                <?php echo anchor('hasil_pemilihan_adik_asuh/detail_pemilihan_adik_asuh/'.$row['id'].'/'.$uri_segment.'', 'detail', 'class=detail title="detail"');?>
            </td>
        </tr>
        <?php
        }
        ?>
    </table>
</div>
<?php
  echo "$pagination";
  }
?>
</fieldset>